require 'migration_helpers'

class CreateAttendances < ActiveRecord::Migration
  extend MigrationHelper::ForeignKeys
  
  def self.up
    create_table :attendances do |t|
      t.column :student_id,           :integer
      t.column :courses_sessions_id,  :integer
      t.column :course_date,          :date
      t.column :time_in,              :date
      t.column :time_out,             :date
      t.column :created_at,           :date
      t.column :updated_at,           :date
    end
    
    add_foreign_key(:attendances, :courses_sessions_id, :courses_sessions)
  end

  def self.down
    drop_table :attendances
  end
end
